package com.tencet.servlet;

import com.tencet.entity.AccountOne;
import com.tencet.service.Impl.AccountOneServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author: Fame
 * @date: 2022-07-20 21:01
 * @description:
 */
@WebServlet("/account1")
public class AccountOneServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String idTwo = req.getParameter("idTwo");
        AccountOneServiceImpl accountService = new AccountOneServiceImpl();
        List<AccountOne> accountOneList = accountService.getAccountOneList(idTwo);
        req.setAttribute("accountOneList",accountOneList);
        req.getRequestDispatcher("account2.jsp").forward(req,resp);
    }
}
